]> dgit.raspbian.org Git - gnome-shell.git/commit
loginManager: Use systemd session auto object to get session ID
authorAlessandro Bono <alessandro.bono369@gmail.com>
Thu, 30 Oct 2025 10:47:17 +0000 (11:47 +0100)
committerAlessandro Bono <alessandro.bono369@gmail.com>
Thu, 30 Oct 2025 11:07:07 +0000 (12:07 +0100)
commit5db3a2b7bcfebdcc71038df890ae44308c98b95e
treed067aad59ff5e9789ee4edec765eab9ad0aede71
parentc21853138be403bcd46e1439503b6656e408316d
loginManager: Use systemd session auto object to get session ID

Relying on the Display property is buggy when the gdm user spawns more than
one gnome-shell instance.
```
$ loginctl
SESSION  UID USER   SEAT  LEADER CLASS         TTY   IDLE SINCE
     11   42 gdm    -     11778  manager-early -     no   -
    c20   42 gdm    seat0 34313  greeter       tty1  yes  17h ago
    c21   42 gdm    -     34938  greeter       -     no   -
    c22   42 gdm    -     35693  greeter       -     no   -
```

From the logs:
```
$ journalctl -b | grep "Will monitor"
[...]
Oct 29 15:14:59 gnome-shell[34961]: Will monitor session c20
Oct 29 15:22:57 gnome-shell[35716]: Will monitor session c20
Oct 29 15:22:58 gnome-shell[35716]: Will monitor session c20
```

Use the systemd session auto object for getting the session id. We can't return
directly the session proxy created from it because it won't emit signals. From
the documentation[1]:
```
Signals are only emitted on objects referencing a specific session ID not on the
"/org/freedesktop/login1/session/self" or "/org/freedesktop/login1/session/auto"
convenience objects, as they can only be dereferenced relative to a method caller.
```

[1] https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.login1.html

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3942>
js/misc/loginManager.js